/**
 * Copyright (c) 2002-2011 旭鸣信息
 * All rights reserved. 
 * File：Error.java
 * History:
 *       2012-1-18: Initially created, tangkf.
 */
package com.xteam.web;

/**
 * 当后台操作出现错误时，将此对象返回给WEB前端，用以判定界面展示方式
 * 
 * @author tangkf  ---2012-1-18
 */
public class Error {
	
	/**
	 * 错误编号，大于0，表示不正常
	 */
	private String errorCode	= "0";
	
	/**
	 * 错误描述
	 */
	private String errorDesc	= "正常";
	
	/**
	 * 调用函数(保留)
	 */
	private String function	= "";
	
	public Error(){
	}
	
	public Error(String code, String desc) {
		this.errorCode	= code;
		this.errorDesc	= desc;
	}

	public Error(String code, String desc, String function) {
		this.errorCode	= code;
		this.errorDesc	= desc;
		this.function	= function;
	}
	
	public static Error create(){
		return new Error();
	}

	public static Error create(String code,String desc){
		return new Error(code,desc);
	}
	
	public static Error create(String code,String desc,String function){
		return new Error(code,desc,function);
	}


	/**
	 * @return 属性function的值.
	 */
	public String getFunction() {
		return this.function;
	}

	/**
	 * @param function 属性function.
	 */
	public void setFunction(String function) {
		this.function = function;
	}

	/**
	 * @return 属性errorCode的值.
	 */
	public String getErrorCode() {
		return this.errorCode;
	}

	/**
	 * @param errorCode 属性errorCode.
	 */
	public void setErrorCode(String errorCode) {
		this.errorCode = errorCode;
	}

	/**
	 * @return 属性errorDesc的值.
	 */
	public String getErrorDesc() {
		return this.errorDesc;
	}

	/**
	 * @param errorDesc 属性errorDesc.
	 */
	public void setErrorDesc(String errorDesc) {
		this.errorDesc = errorDesc;
	}
}